import java.util.Scanner;
public class ArrayExamples{
  public static void main(String[] args){
  	Scanner scanner = new Scanner(System.in);
    double[] grades = {80.0, 65.5, 40.0, 72.5, 90.0, 35.8, 56.5};
    
    System.out.println("\nThe grades are: ");
    for(int k = 0; k < grades.length; k++)
      System.out.print(grades[k] + "  ");
     
    int[] nums = new int[5]; 
    String[] cities = new String[4];
    
    System.out.println("\nBefore initializing nums array: ");
    for(int k = 0; k < nums.length; k++)
       System.out.print(nums[k] + "  ");
    
    // Initializing nums array
    for(int k = 0; k < nums.length; k++)
       nums[k] = k + 1;
    
    System.out.println("\nAfter initializing nums array: ");
    for(int k = 0; k < nums.length; k++)
       System.out.print(nums[k] + "  ");
       
    System.out.println("\nBefore initializing cities array: ");
    for(int k = 0; k < cities.length; k++)
       System.out.print(cities[k] + "  ");
     
    System.out.println();
    // Initializing cities array  
    for(int k = 0; k < cities.length; k++){
       System.out.print("Enter name of city#" + (k+1) + ": ");
       cities[k] = scanner.nextLine();
    }
    
    System.out.println("\nAfter initializing cities array: ");
    for(int k = 0; k < cities.length; k++)
       System.out.print(cities[k] + "  ");
  }
}